Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce BlobStore & IdStore APIs #1126

Merged
merged 4 commits into from
Feb 28, 2025
Merged

Introduce BlobStore & IdStore APIs #1126

merged 4 commits into from
Feb 28, 2025

Conversation

vorburger
Copy link
Member

Relates to #777.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @vorburger, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request introduces the BlobStore and IdStore APIs, along with an initial implementation for IPFS. The BlobStore interface defines methods for storing and loading blobs of data using CIDs (Content Identifiers). The IdStore interface defines methods for linking IDs to CIDs. The pull request also includes an IPFS implementation of the BlobStore interface, which allows storing and retrieving data from IPFS. Additionally, the pull request includes updates to the BUILD files and minor refactoring of IPFSResource and IPFSResourceTest to align with the new package structure.

Highlights

  • API Introduction: Introduces BlobStore and IdStore interfaces for content-addressable storage.
  • IPFS Implementation: Provides an initial IPFS implementation of the BlobStore interface.
  • Dependency Injection: Leverages IPFSResource.Provider for accessing IPFS resources.

Changelog

Click here to see the changelog
  • java/dev/enola/cas/BUILD
    • Added a new BUILD file for the dev.enola.cas package, defining the cas java_binary and tests junit_tests.
    • Includes dependencies on common Enola libraries, guava, ipld-java-cid, multiformats, jspecify, and slf4j.
  • java/dev/enola/cas/BlobStore.java
    • Created a new BlobStore interface with store and load methods for content-addressable storage.
    • The interface uses CIDs (Content Identifiers) for addressing blobs.
    • Includes a comment mentioning various potential implementations like local files, Key Value Stores, casync, IPFS, Iroh Network, and consensus-based systems.
  • java/dev/enola/cas/IPFS.java
    • Created a new IPFS class implementing the BlobStore interface.
    • The IPFS class uses an IPFSResource.Provider to access IPFS resources.
    • The load method retrieves data from IPFS using the provided CID.
    • The store method is currently implemented with UnsupportedOperationException.
  • java/dev/enola/cas/IPFSResource.java
    • Moved IPFSResource from dev.enola.common.io.resource to dev.enola.cas package.
    • No functional changes.
  • java/dev/enola/cas/IPFSResourceTest.java
    • Moved IPFSResourceTest from dev.enola.common.io.resource to dev.enola.cas package.
    • Added imports for OkHttpResource, ReadableResource, and ResourceProvider from dev.enola.common.io.resource.
  • java/dev/enola/cas/IdStore.java
    • Created a new IdStore interface with link and get methods for linking IDs to CIDs.
    • The interface uses ByteSeq for IDs and CIDs for content addresses.
  • java/dev/enola/cas/package-info.java
    • Created a new package-info.java file for the dev.enola.cas package.
    • Includes a description of CAS (Content-addressable storage) and the @NullMarked annotation.
  • java/dev/enola/cli/BUILD
    • Added //java/dev/enola/cas as a dependency to the cli java_binary.
  • java/dev/enola/cli/CommandWithResourceProvider.java
    • Added import for dev.enola.cas.IPFSResource.
  • java/dev/enola/common/io/hashbrown/Multihashes.java
    • Added a TODO comment to support blake3 hashing algorithm, referencing issue Blake3 #1125.
    • Added a TODO comment regarding murmur3-x64-64, with a warning about a potential issue in Guava.
  • java/dev/enola/common/io/resource/ResourceProvider.java
    • Updated TODO comments regarding ResourceProvider interface.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Trivia time!

What does IPFS stand for?

Click here for the answer
InterPlanetary File System

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the BlobStore and IdStore APIs, providing an abstraction for content-addressable storage. The code includes interfaces for storing and retrieving blobs and linking IDs to CIDs, along with an IPFS implementation of the BlobStore interface. Overall, the changes seem well-structured and introduce useful abstractions. However, there are a few areas that could be improved.

Summary of Findings

Merge Readiness

The pull request introduces important new abstractions for content-addressable storage. While the code appears to be well-structured, the IPFS implementation of BlobStore currently only supports loading and not storing. Additionally, the IdStore interface is introduced but not implemented. Before merging, it would be beneficial to either implement the store method in IPFS or provide a clear indication of when it will be implemented. Also, consider providing a basic implementation of IdStore or clarifying its intended use. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. Given the unimplemented store method and the lack of an IdStore implementation, I recommend that the pull request not be merged until these are addressed.

@vorburger vorburger merged commit e85a8f9 into enola-dev:main Feb 28, 2025
9 checks passed
@vorburger vorburger deleted the cas1 branch February 28, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant